// TCPSocketClient.h

#pragma once

#include "TCPSocketDef.h"

class TCPSocketClient
{
public:
    explicit TCPSocketClient(void);
    virtual ~TCPSocketClient(void);

public:
    // Open TCP.
    DWORD OpenTCP(void* pParent, std::string strServerHost, int nServerPort);

    // Close TCP.
    DWORD CloseTCP(void);

    // Send data.
    DWORD SendData(std::string strBuffer);

public:
    TCP_ERROR_CALLBACK m_pfOnTCPError;

private:
    SOCKET m_socketTCP;
    SOCKADDR_IN m_sockaddrin;
    HANDLE m_hExitThreadEvent;
    void* m_pParent;
};
